<?php
	if(array_filter($_POST))
	{
		$data = array(
			'catename'=>$_POST['cname'],
			'sort'=>$_POST['sort']?$_POST['sort']:0,
			'type'=>$_POST['type']?$_POST['type']:1,
			'status'=>$_POST['status']?$_POST['status']:0,
		);
		$_->cates->_insert($data);
	}
	$list = $_->cates->_select('');

	$smarty->_assign(array('list'));
	$smarty->_display();
?>